import re from datetime import datetime DBCol = [{'colname':'日付','format':'日付:YYYY/MM/DD'}] def pagedb(page): m = re.match(r'日付:(\d\d\d\d/\d\d/\d\d)',page.text) if m == None: return (None) else: date = datetime.strptime(m[1], "%Y%m%d") return (date)